package com.xzakota.minesweeper.msg;

import com.xzakota.minesweeper.log.XLogger;

/**
 * 注册消息默认处理器
 *
 * @author Xzakota
 */
public class SignUpMsgDefaultHandler extends DefaultHandler {
    @Override
    public void handle(BaseMsg msg) {
        resultMsgText = switch (msg.code) {
            case MsgCode.BASE_SUCCESS -> "注册成功";
            case MsgCode.BASE_FAIL -> "注册失败";
            case MsgCode.SIGN_UP_USER_EXIST -> "用户已存在";
            case MsgCode.SIGN_UP_ERROR_PARAMETER -> "注册参数错误";
            default -> throw new IllegalStateException("Unexpected value: " + msg.code);
        };

        XLogger.info(resultMsgText);
    }
}
